<?php echo form_open_multipart(BASE_URL . '/' . $this -> admin . '/create_award', array('id' => 'award_form', 'method' => 'post')); ?>
<!--form starts-->
<div class="form_container">
	<h4>Create Award</h4>
	<!--row starts-->
	<div class="success_msg" style="margin-left:15px;">
		<?php
		if (isset($error) && $error != '') {
			echo $error;
		} else if ($this -> session -> userdata('award_success')) {
			echo $this -> session -> userdata('award_success');
			$this -> session -> set_userdata('award_success', '');
		}
		?>
	</div>
	<!--row starts-->
	<div class="row1">
		<div class="form-group col-sm-12">
			<label for="eventname2">Event Name <span class="asterisk">*</span></label>
			<select class="form-control white" required id="selectevent" name="selectevent">
				<option value=""> Choose Event </option>
				<?php if(isset($event_data) && !empty($event_data)){ 
					foreach($event_data as $temp){?>
						<option value="<?php echo $temp['event_id']; ?>" <?php if(isset($post_value[0]['award_event_id']) && $post_value[0]['award_event_id']==$temp['event_id']){echo  'selected';}else if(set_value('selectevent') == $temp['event_id']){ echo 'selected';} ?>><?php echo $temp['event_name']; ?></option>
				<?php }}?>
			</select>
			<div class="error" id="err-event1"></div>
		</div>
		<div class="clearfix"></div>
	</div>
	<!--row closed-->
	<!--row starts-->
	<div class="row1">
		<div class="form-group col-sm-12">
			<label for="awardname2">Award Name <span class="asterisk">*</span></label>
			<input class="form-control white" required placeholder="Enter Award Name" id="awardname" name="awardname" type="text" value="<?php if(isset($post_value[0]['award_name']))echo $post_value[0]['award_name']; else echo set_value('awardname'); ; ?>">
			<div class="error" id="err-award"></div>
		</div>
		<div class="clearfix"></div>
	</div>
	<!--row closed-->
	<!--row starts-->
	<div class="row1">
		<div class="form-group col-sm-12">
			<label for="Description2">Description</label>
			<textarea class="form-control white" id="description2" name="description2"><?php if(isset($post_value[0]['award_description']))echo $post_value[0]['award_description'];else echo set_value('description2'); ?></textarea>
			<div class="error" id="err-desc2"></div>
			<script type="text/javascript" src="<?php echo ASSET_URL; ?>ckeditor/ckeditor.js?t=B5GJ5GG"></script>
			<script type="text/javascript">
				//<![CDATA[
				CKEDITOR.replace('description2', {
					"toolbar" : "Standard"
				});
				//]]>
			</script>
		</div>
		<div class="clearfix"></div>
	</div>
	<!--row closed-->
	<!--row starts-->
	<div class="row1">
		<div class="form-group col-sm-12">
			<label for="select1">Admin Incharge <span class="asterisk">*</span></label>
			<select class="form-control white" required id="admin_select" name="admin_select">
				<option value=""> Choose Admin Incharge </option>
				<?php if(isset($admin_data) && !empty($admin_data)){
					foreach($admin_data as $temp => $rows){ ?>
						<option value="<?php echo $rows->admin_id; ?>" <?php if(isset($post_value[0]['award_incharge_id']) && $post_value[0]['award_incharge_id'] == $rows->admin_id)echo 'selected';else if(set_value('admin_select') == $rows->admin_id)echo 'selected'; ?>><?php echo $rows->admin_fullname; ?></option>
				<?php }}?>
			</select>
			<div class="error" id="err-admin1"></div>
		</div>
		<div class="clearfix"></div>
	</div>
	<!--row closed-->
	<!--row starts-->
	<div class="row1">
		<div class="form-group col-sm-12">
			<label for="select2">Chief Panelist <span class="asterisk">*</span></label>
			<select class="form-control white" required id="cp_select" name="cp_select">
				<option value=""> Choose Chief Panelist </option>
				<?php if(isset($panelist_data) && !empty($panelist_data)){
					foreach($panelist_data as $temp){?>
				<option value="<?php echo $temp['admin_id'];?>" <?php if(isset($post_value[0]['award_panelist_admin_id']) && $post_value[0]['award_panelist_admin_id'] == $temp['admin_id'])echo 'selected' ;else if(set_value('cp_select') == $temp['admin_id'])echo 'selected'; ?>><?php echo $temp['admin_fullname'];?></option>
				<?php }}?>
			</select>
			<div class="error" id="err-pan"></div>
		</div>
		<div class="clearfix"></div>
	</div>
	<!--row closed-->

	<!--row starts-->
	<div class="row1">
		<div class="form-group col-sm-12">
			<label for="select4">Status </label>
			<select class="form-control white" required id="status_select" name="status_select">
				<option value="New" <?php if(isset($post_value[0]['award_current_status']) && $post_value[0]['award_current_status'] == 'New')echo 'selected' ;else if(set_value('status_select') == 'New')echo 'selected'; ?>> New </option>
				<option value="On-going" <?php if(isset($post_value[0]['award_current_status']) && $post_value[0]['award_current_status'] == 'On-going')echo 'selected' ;else if(set_value('status_select') == 'On-going')echo 'selected'; ?>> Ongoing </option>
				<option value="Done" <?php if(isset($post_value[0]['award_current_status']) && $post_value[0]['award_current_status'] == 'Done')echo 'selected' ;else if(set_value('status_select') == 'Done')echo 'selected'; ?>> Done </option>
			</select>
			<div class="error" id="err-stat"></div>
		</div>
		<div class="clearfix"></div>
	</div>
	<!--row closed-->
	<!--row starts-->
	<div class="row1">
		<div class="form-group col-sm-12">
			<label for="select5">Required Refree </label>
			<select class="form-control white" required id="refree_select" name="refree_select">
				<option value="0" <?php if(isset($post_value[0]['award_refree_count']) && $post_value[0]['award_refree_count'] == '0')echo 'selected' ;else if(set_value('refree_select') == '0')echo 'selected'; ?>> 0 </option>
				<option value="1" <?php if(isset($post_value[0]['award_refree_count']) && $post_value[0]['award_refree_count'] == '1')echo 'selected' ;else if(set_value('refree_select') == '1')echo 'selected'; ?>> 1 </option>
				<option value="2" <?php if(isset($post_value[0]['award_refree_count']) && $post_value[0]['award_refree_count'] == '2')echo 'selected' ;else if(set_value('refree_select') == '2')echo 'selected'; ?>> 2 </option>
			</select>
			<div class="error" id="err-ref"></div>
		</div>
		<div class="clearfix"></div>
	</div>
	<!--row closed-->
	<!--row starts-->
	<div class="row1">
		<div class="form-group col-sm-12">
			<label for="awardname2">Start Date <span class="asterisk">*</span></label>
			<input class="form-control white" required placeholder="Enter Start Date" id="startdate" name="startdate" type="text" value="<?php if(isset($post_value[0]['award_start_date']))echo date("d-m-Y",strtotime($post_value[0]['award_start_date']));else echo set_value('startdate'); ?>">
			<div class="error" id="err-sdate"></div>
		</div>
		<div class="clearfix"></div>
	</div>
	<!--row closed-->
	<!--row starts-->
	<div class="row1">
		<div class="form-group col-sm-12">
			<label for="awardname2">End Date <span class="asterisk">*</span></label>
			<input class="form-control white" required placeholder="Enter End Date" id="enddate" name="enddate" type="text" value="<?php if(isset($post_value[0]['award_end_date']))echo date("d-m-Y",strtotime($post_value[0]['award_end_date']));else echo set_value('enddate'); ?>">
			<div class="error" id="err-edate"></div>
		</div>
		<div class="clearfix"></div>
	</div>
	<!--row closed-->
	<!--row starts-->
	<div class="row1">
		<div class="form-group col-sm-12">
			<label for="file2">Award Logo</label>
			<input class="form-control white" id="award_file" name="award_file" type="file" value="">
			<div class="error" id="err-file"><?php if($this->session->userdata('award_success1')) echo $this->session->userdata('award_success1');$this->session->set_userdata('award_success1', ''); ?></div>
		</div>
		<div class="clearfix"></div>
	</div>
	<!--row closed-->
</div>
<!--form closed-->
<div class="space30"></div>
<button type="button" class="btn btn-primary" id="award_btn">
	Save & Continue
</button>
<?php echo form_close(); ?>